﻿<Window x:Class="PocketBook.Views.SelectPageView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" Title="SelectPageView" Height="300" Width="260" WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
    <Grid Margin="4" x:Name="LayoutRoot">
        <Grid.Resources>
            <Style TargetType="{x:Type Button}">
                <Setter Property="MinWidth" Value="85" />
            </Style>
        </Grid.Resources>
       
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <TextBlock Text="{Binding Prompt, Mode=OneTime}" Padding="2" />
        <ListBox x:Name="PageList" Grid.Row="1" DisplayMemberPath="DisplayName" SelectedItem="{Binding SelectedPage}" >
            <ListBox.Resources>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="cal:Action.TargetWithoutContext" Value="{Binding DataContext, ElementName=LayoutRoot}" />
                    <Setter Property="cal:Message.Attach" Value="[Event MouseDoubleClick] = [Action ActivateItem($dataContext)]" />
                </Style>
            </ListBox.Resources>
        </ListBox>
        <StackPanel Grid.Row="2" Margin="0,4,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button x:Name="Save" Content="OK" IsDefault="true" />
            <Button Content="Cancel" IsCancel="true" Margin="4,0,0,0" />
        </StackPanel>
        
        
    </Grid>
</Window>
